Fix for create_chart requests without folder_id paramter defined #64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is a proposed fix for issue #61.
Context
Recently there were changes made to the Datawrapper API, whereby
POST /charts
requests (to create a new chart) now return a403
if the folder sent in the payload is invalid. i.e if it either:organizationId
(i.e corresponds to a folder that isn't in that team/organization)The current implementation in this library is such that if the user doesn't specify a
folder_id
it gets sent along with the create request as an empty string, which is invalid, so Datawrapper returns a403
and the chart doesn't get created.Changes
folderId
along with thePOST /charts
request if the user specified it in their call ofcreate_chart
.folder_id
was defined, that suggests that the folder_id may be the issueType of Change
Checklist
CODE_OF_CONDUCT.md
document.CONTRIBUTING.md
guide.make codestyle
.-I've written tests for all new methods and classes that I created.- I've written the docstring in Google format for all the methods and classes that I used.I had to commit with
--no-verify
because of a failing commit hook, that I unfortunately couldn't figure out how to solve (pretty new to Python, sorry 🙈)